package com.zkh.myutils.io.excel.worksheet.style;

import java.util.Objects;

/**
 * 单元格组合样式
 * @author zkh
 */
public class CellXf {
	//数字格式ID
	private int numFmtId;
	//字体样式ID
	private int fontId;
	//背景样式ID
	private int fillId;
	//边框ID
	private int borderId;
	//单元格样式ID
	private int xfId;
	//对齐方式
	private Alignment alignment;

	/**
	 * 构造方法
	 * @param numFmtId 数字格式索引
	 * @param fontId 字体样式索引
	 * @param fillId 背景样式索引
	 * @param borderId 边框样式索引
	 * @param alignment 对齐方式
	 */
	public CellXf(int numFmtId, int fontId, int fillId, int borderId, Alignment alignment) {
		super();
		this.numFmtId = numFmtId;
		this.fontId = fontId;
		this.fillId = fillId;
		this.borderId = borderId;
		this.alignment = alignment;
	}
	
	public int getNumFmtId() {
		return numFmtId;
	}
	public void setNumFmtId(int numFmtId) {
		this.numFmtId = numFmtId;
	}
	public int getFontId() {
		return fontId;
	}
	public void setFontId(int fontId) {
		this.fontId = fontId;
	}
	public int getFillId() {
		return fillId;
	}
	public void setFillId(int fillId) {
		this.fillId = fillId;
	}
	public int getBorderId() {
		return borderId;
	}
	public void setBorderId(int borderId) {
		this.borderId = borderId;
	}
	public int getXfId() {
		return xfId;
	}
	public void setXfId(int xfId) {
		this.xfId = xfId;
	}
	public Alignment getAlignment() {
		return alignment;
	}
	public void setAlignment(Alignment alignment) {
		this.alignment = alignment;
	}
	@Override
	public int hashCode() {
		return Objects.hash(alignment, borderId, fillId, fontId, numFmtId,
				xfId);
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CellXf other = (CellXf) obj;
		return Objects.equals(alignment, other.alignment)
				&& borderId == other.borderId && fillId == other.fillId
				&& fontId == other.fontId && numFmtId == other.numFmtId
				&& xfId == other.xfId;
	}
}
